cmake_minimum_required(VERSION 2.4)

FIND_PATH(PROJECT_HOME acapella/shared_ptr.hpp . .. ../.. NO_DEFAULT_PATH)
FIND_LIBRARY(PTHREAD_LIB pthread /usr/lib)


include(${PROJECT_HOME}/common.cmake)

INCLUDE_DIRECTORIES(
    .
    ${PROJECT_HOME}
)

LINK_LIBRARIES(
        ${PTHREAD_LIB}
        )


SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_HOME}/unittest/bin)


ADD_CUSTOM_COMMAND(
    TARGET testAll
    PRE_BUILD
    COMMAND python ${PROJECT_HOME}/code_generator/delegate_generator.py
    COMMAND python ${PROJECT_HOME}/code_generator/filter_generator.py
    )

ADD_DEFINITIONS(
  -dDEBUG
)

ADD_EXECUTABLE(testAll
    gtest-all.cc
    testMain.cpp
    testFunctor.cpp
    testDelegate.cpp
    testQueue.cpp
	testSerialize.cpp
	testTask.cpp
	testWorker.cpp
	testThread.cpp
	testThreadWorker.cpp
	#testCharSet.cpp
	testStringUtil.cpp
	testTime.cpp
	testEncode.cpp
	testHttpUtil.cpp
	testTools.cpp
	testTypeTraits.cpp
	testTypeList.cpp
	testSharedMemory.cpp
	testDir.cpp
)

ADD_EXECUTABLE(testStarTree
  gtest-all.cc
  testMain.cpp
  testStarTree.cpp
)

ADD_EXECUTABLE(testSharedPtr
  testSharedPtr.cpp
)

ADD_EXECUTABLE(testSharedHandle
  testSharedHandle.cpp)
